package com.mycinema.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mycinema.dao.MovieDao;
import com.mycinema.entity.Movie;
import com.mycinema.service.MovieService;

@Service //业务类
public class MovieServiceImpl implements MovieService {
	
	@Autowired
	private MovieDao movieDao;

	public List<Movie> getAll() {
	
		return movieDao.getAll();
	}

	public List<Movie> getMoviesTitleCid(int cid, String title) {
		
		return movieDao.getMoviesTitleCid(cid, title);
	}

	public void updateMovie(Movie movie) {
		movieDao.updateMovie(movie);		
	}

	public List<Movie> getMoviesPage(int cid, String title, int startIndex, int pageSize) {
		
		return movieDao.getMoviesPage(cid, title, startIndex, pageSize);
	}

	public int getRows(int cid, String title) {		
		return movieDao.getRows(cid, title);
	}

	public Movie getById(int id) {
		return movieDao.getById(id);
	}
    
	public void addMovie(Movie movie) {
		movieDao.addMovie(movie);		
	}

}
